<template>
    <div class="creative-courses-nav">
        <el-menu :default-active="activeIndex" class="el-menu-demo"  mode="horizontal" :router="true">
            <el-menu-item index="/Teaching/Course/MakeCourseList" class="commonStyle">制作课程</el-menu-item>
            <el-menu-item index="/Teaching/Course/ReportTemplate" class="commonStyle">报告模板</el-menu-item>
        </el-menu>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                activeIndex: ''
            }
        },
        created() {
            let self = this
            self.fetchDate()
        },
        methods: {
            fetchDate() {
                let self = this
                var cur_path = self.$route.meta.navActive; //获取当前路由
                self.activeIndex = cur_path
            }
        },
        watch: {
            "$route": "fetchDate"
		}
    }
</script>
<style>
   .commonStyle{
       border-bottom-color:#7c86a1!important
   }
</style>

<style lang="scss" scoped>
    .creative-courses-nav{
        width: 280px;
        margin: 35px auto 0;
        .el-menu-demo{
            background: rgba(0,0,0,0);
            text-align: center;
            border: none;
            &.el-menu--horizontal>.el-menu-item.is-active{
                border: solid 1px #1277eb;
                color: #1277eb;
                background: none;
            }
            .el-menu-item{
                width: 100px;
                height: 30px;
                line-height: 28px;
                box-sizing: border-box;
                padding: 0;
                margin: 0 20px;
                font-size: 16px;
                color: #7c86a1;
                // border: solid 1px #f8f8f8;
                border: 1px solid #7c86a1;
                &:hover{
                    border: solid 1px #1277eb;
                    color: #1277eb;
                }
            }
            &.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{

                background: none;
            }
        }
    }
</style>
